聊天界面是最适合检验材质与动效关系的地方。

同一个气泡需要不断出现、变高、把后面的消息推开,还可能从中间消失。只要材质只是换颜色,动画只是套缩放,六种风格最终会像同一套组件换了皮。

真正有性格的聊天界面,会让气泡的质感决定它如何进入、如何等待、如何离开。

先固定气泡的共同几何

材质可以不同,气泡的阅读结构必须一致。

这套探索稿使用 28px 字号、38px 行高、17px 26px 内边距、2px 边框和 38px 圆角。单行时形成胶囊,多行时自然变成圆角矩形。自己的消息在右,AI 在左,距离页面边缘 48px,长文本在固定宽度内提前排好。

这些数值是探索 Demo 的比例,不是所有产品都必须照搬的绝对尺寸。真正要保留的是关系:

  • 气泡的圆角来自一行文字的高度;
  • 多行文本必须在动画开始前完成排版;
  • 动画不能改变字号、宽度或换行位置;
  • 文本始终留在 DOM 中,Canvas 只能绘制外壳或效果。

同一发送者连续发出的消息构成一组:组内间距 4px,组间 16px。气泡需要知道自己属于 single、first、middle 还是 last,因为加入或删除一条消息时,组边缘的圆角也会随之变化。

Cirrus、Aqua 和拟物风格在组内相接的一侧收窄到约 10px。Solid 与 Gradient 保持圆形气泡,只在组末增加一个由两块伪元素组成的尾巴。插入、删除或改变组身份时,尾巴应在约 160ms 内淡入淡出。

六种材质,六种物理性格

Cirrus:轻磨砂玻璃与云的空气感

Cirrus 没有描边和投影,只有薄磨砂、细颗粒和一层蓝色天空。

天空不是普通渐变,而是由云层密度、太阳方向和 6 层噪声组成的慢速画面。它先渲染成约页面两倍尺寸的图片,再让背景缓慢左右漂移。玻璃本身用 backdrop-filter: blur(26px) saturate(130%) 取景,颗粒与 tint 放在伪元素里。

发送时,气泡从 40px 下方升起,在约 560ms 内从透明玻璃逐渐结霜;缩放和淡入更快完成。长回复等待时,6×6 点阵像一圈缓慢散开的热量;删除时,气泡先退去霜面,再淡出。

它适合轻盈、干净、偏向“空气”而非“硬件”的产品。

Pixel:网格、抖动与像素物理

Pixel 的外壳不是 DOM 边框,而是一张按 4px 网格绘制在 Canvas 上的图。

每一帧都要重新计算气泡当前的位置、尺寸、缩放和圆角,判断哪些格子属于气泡、哪些格子构成外轮廓。离开的格子不会立刻消失,而会留下按指数衰减的 trace,再用 4×4 Bayer 阈值决定是否绘制,从而形成像素拖影。

文字仍然留在 DOM 中,只把位置吸附到网格。背景是深色棋盘,气泡用纯色填充和像素字体的硬阴影建立层级。

这种材质适合做成套视觉语言:等待态是摆动的小像素钟摆,发送时逐格放大,删除时打散成格子消失,菜单从顶部一格一格擦入。

Aqua:高光、果冻与体积回弹

Aqua 借鉴早期 Mac 的果冻质感:渐变表面、内侧底部辉光、顶部白色反光、深色描边和柔和投影。

发送时,气泡从 0.5 倍弹性放大,同时宽度与高度短暂反向摆动,再在约 0.2 秒内收敛。它会让纵向最多增长到 1.04 倍,避免顶到上一条消息。

等待态是水滴落在水面的环形波纹;删除时膨胀到 1.14 再破掉。所有动作都要保持“有体积、可变形、但不会失控”的边界。

Gradient:贯穿整段对话的颜色坐标

Gradient 的关键不是给每个气泡各自加渐变,而是让整段对话共享一条纵向渐变。

每个气泡用 --top 表示自己在对话中的当前位置,背景尺寸等于整段对话高度。消息移动时,同一气泡显示的是渐变中属于它当前高度的切片,所以颜色会随位置变化。自己的气泡、组末尾巴和发送按钮都从同一色系取色。

发送时从 16px 模糊中聚焦;等待态是两颗薄荷到青色的小光点环绕;删除时气泡放大并溶解成 24px 模糊。它更像品牌色彩的流动,而不是一张固定贴图。

拟物:把气泡当成可按下的实体

拟物风格沿用 001 中拟物按钮的同一套配方:顶部内高光、底部内暗线、细描边、短投影与较长的环境阴影。

自己的气泡是深灰金属渐变,AI 气泡是白色纸面;文字也带有轻微的光照方向。它既可以复古,也可以显得厚实、可靠,关键在光照关系一致。

发送时像按下一枚实体键,先从 1.1 倍压回并短暂低于 1;等待态是一颗在 4×4 网格里弹跳的球;删除时被压下、下落并淡出。

Solid:基础对照组

Solid 没有阴影、纹理和大特效,只有蓝色自己的消息、浅灰的 AI 消息和稳定的白色背景。

它不是为了“最朴素”,而是提供两个基准:可读性和性能。任何材质都应该能回答,它相比 Solid 多带来了什么;如果答案只是更像装饰,那么它可能不值得承担渲染成本。

线程要作为一个整体移动

消息气泡不是孤立组件。新消息出现、旧消息删除、AI 回复变高时,整段对话都要重新分配空间。

最稳的实现是从底部向上排版,先算出每个气泡的目标位置,再用 transform: translateY() 放置。新增、删除或尺寸变化后,每个气泡从当前位置独立跟随自己的目标,不能让整块列表瞬间跳位。

如果必须保留普通文档流,可以用 FLIP:先记录旧位置,再让布局发生,最后从旧位置动画到新位置。

六种材质使用不同的弹簧响应,让同一布局变化带上不同的重量:

材质 Response Damping
Cirrus 0.50s 0.88
Pixel 0.42s 0.80
Aqua 0.46s 0.74
Gradient 0.52s 0.92
拟物 0.34s 0.84
Solid 0.42s 0.86

不要动画 top、height 或 margin,也不允许在追赶过程中发生气泡重叠。用户向上翻阅历史时,底部固定规则必须暂停,不能把滚动位置强行拉回最新消息。

发送:气泡按材质的规则出现

所有发送都从目标位置下方约 40px 开始,但“如何落位”由材质决定:

  • Cirrus 先透明后结霜,缩放和淡入先后完成;
  • Pixel 以阶梯式缩放出现,并通过抖动淡入;
  • Aqua 像果冻一样弹性放大;
  • Gradient 从散焦变清晰;
  • 拟物从略大压回,像按下实体按键;
  • Solid 使用最短、最稳定的缩放与淡入。

这几种动作共享同一空间路径,却传达了不同的材料。不要把六种动画都写成同一个 scale 曲线再换时长,那样材质仍然只是表皮。

长回复:等待态也要属于同一种材质

AI 思考中的点阵不是通用的“三个点”。

在这个方案里,等待态是一块约 48px 的方形矩阵,每个材质运行自己的小物理系统:

  • Cirrus:高斯热量沿圆环扩散;
  • Pixel:像素钟摆以正弦摆动;
  • Aqua:水滴引发的波纹向外衰减;
  • Gradient:两颗光点沿薄荷到青色的路径环绕;
  • 拟物:小球在网格中弹跳;
  • Solid:一根被拨动后衰减的弦。

亮度必须是时间的连续函数,不能只是在离散帧之间开关。移动状态还需要按短暂快门做动态模糊,避免点阵变成闪烁的像素噪点。

回复落地时,气泡从矩阵所在的角落展开到完整尺寸,矩阵同时淡出。文本必须提前按最终宽度排好并在气泡内裁切,展开过程中不能重新换行。随后文字按材质节奏依次出现。

删除:从中间离开仍要保持秩序

长按气泡时,气泡先被压到 0.94–0.97,再抬到 1.02–1.04;其他消息降到约 35–50% 的可见度,Gradient 还会轻微失焦。菜单在当前气泡的发送者一侧展开。

确认删除后,菜单先以 160–200ms ease-in 离开,气泡再按材质消失:

  • Cirrus 退去霜面;
  • Pixel 打散为格子;
  • Aqua 膨胀后破裂;
  • Gradient 放大并溶于模糊;
  • 拟物被压下、下落;
  • Solid 缩小并模糊。

气泡一开始离开,就要同时移出布局。上方消息依次落入缺口,最靠近缺口的一条先动,其他消息逐条跟上;落到底部时保留一部分向下速度并反向,让它们轻轻弹回,而不是压进下一条消息。

如果缺口两侧是同一发送者,删除后它们应重新合并成一组。动画不能只负责“消失”,还要负责空间关系恢复。

Retrofit 只改授权范围内的东西

如果是在已有聊天产品中改造,默认只改气泡的材质、发送、长回复文字、长按和退场。

输入框、发送按钮、消息菜单和等待指示器都需要单独确认;图标一律不动。Retrofit 不能改变消息数据、组件 props 和加载方式,也不能为了演示而替换整个聊天架构。

先列出现有气泡、线程布局、滚动方式、动画和可疑的布局抖动,再切换材质。如果发现当前列表在消息出现时会跳、文本播放时会重新换行,应该先修这些根因,而不是用遮罩掩盖。

性能与可访问性是材质的一部分

只动画 transform、opacity 和必要的 filter / backdrop-filter。每次新动作都应从当前视觉状态打断旧动画,不能等旧动画播放完再响应。

在 prefers-reduced-motion: reduce 下,保留淡入淡出,去掉位移、缩放与模糊;等待矩阵停在一个静止帧,线程位置直接更新。减少动态效果不是取消状态反馈。

切换材质时,线程要在当前位置淡出,再以新材质淡入。用户不应因为换主题而重新看到整套历史消息播放一次。

检查清单

  • 六种材质是否共享同一气泡几何与阅读结构;
  • 单行、多行、组首、组中、组末是否正确改变圆角与尾巴;
  • 文本是否按最终宽度提前排版,动画中不重新换行;
  • 线程是否从底部排版并整体跟随,不是逐条跳位;
  • 材质是否影响发送、等待、回复展开和删除,而不只影响静态外观;
  • 等待点阵是否是连续运动,并有动态模糊;
  • 删除时是否从布局中及时移除,并让上方消息保持秩序;
  • 是否只修改气泡,或对 composer、菜单、指示器逐项取得许可;
  • 是否动画 transform、opacity、filter,而不是布局属性;
  • 减少动态效果时是否仍保留可理解的状态变化。

消息气泡材质与动效示例 Prompt

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
Prompt

Message bubbles with a material, and motion that follows the material: sending, a long reply coming in, and deleting one from the middle, in an AI chat. Six materials are specified below with exact values. Use them either way:
- Rebuild: make a standalone demo of a chat thread that plays the three motions in one material, with tabs to switch between materials.
- Retrofit: give the bubbles in my existing chat a material and this motion, inside my code and design system, keeping the message data, the components and how messages load.
Ask me which one, and which material(s), before you start.

Retrofit scope: by default, change only the bubbles: their material (sections 1 and 2) and their motion (sections 3, 4, the reply opening and words in 5, and the bubble's long press and exit in 6). Leave every icon as it is. The cursor is for the rebuild demo only. Ask me separately, one at a time, before touching each of these, and change it only if I say yes:
- the composer: the input field and the send button;
- the message menu: its look, its items and how it opens and closes;
- the typing indicator: replacing it with the dot matrix in section 5.

0. Start from what exists (retrofit)
- Find the thread, the bubble component and wherever messages are added, edited or removed, and note the composer, the message menu and the typing indicator. List how the thread is laid out and scrolls, and every animation it has now.
- Flag a thread that jumps when a message arrives or leaves, a bubble whose lines rewrap while it animates, and anything that animates top, height or margin.

1. The bubble box (the same in every material)
- Text 28px on a 38px line, letter-spacing -0.01em, padding 17px 26px, a 2px border (transparent unless the material gives it a color), radius 38px: a capsule for one line, a rounded rectangle when it wraps. Plain circular arcs only, no superellipse or corner-shape. The send button is a circle.
- Mine on the right, theirs (the AI) on the left, 48px from the sides. Long messages wrap inside a fixed width (680px here); lay the text out at that width from the start.
- Messages in a row from one sender form a group: 4px apart inside a group, 16px between groups. Mark each bubble single, first, middle or last, and reshape the group with a 200ms border-radius transition when a message joins or leaves:
- Aqua, skeuomorphic, cirrus: where two bubbles of a group meet, the corners on the sender's side close to 10px.
- Solid, gradient: every bubble stays round; only the last of a group gets a tail, two pseudo-elements at the bottom corner on the sender's side (shown here for mine; mirror them for theirs):
.bubble::before { bottom: -2px; right: -14px; width: 64px; height: 38px; background: <bubble color>;
border-bottom-left-radius: 18px 14px; border-bottom-right-radius: 3px; }
.bubble::after { bottom: -2px; right: -34px; width: 32px; height: 42px; background: <page background>;
border-bottom-left-radius: 20px 24px; }
The blob sticks out 12px; the scoop beside it cuts it into a curl. Fade them in over 160ms when a bubble becomes the last of its group.

2. The six materials
Each one sets the paint, the type and the background (and, in the rebuild demo, the composer, the menu and the cursor). Keep them as tokens. In a retrofit, use the bubble values; take the background only if the material needs it to read (cirrus needs its sky, gradient a dark background) and ask me first. The CSS below is exact: copy it to match the look. ".me" is my bubble, ".them" the AI's; the base font is Inter.

Cirrus (light, clean): thin frosted panes with no edge and no shadow, over a blue sky.
.bubble { border-color: transparent; background: none; box-shadow: none;
backdrop-filter: blur(26px) saturate(130%); }
.bubble::before { content: ''; position: absolute; inset: -2px; border-radius: inherit;
background: var(--grain), var(--tint); } /* text sits above it */
.bubble.me { --tint: rgb(46 128 232 / 0.34); color: rgb(255 255 255); }
.bubble.them { --tint: rgb(104 134 168 / 0.34); color: rgb(255 255 255); }
--grain: a 160px SVG tile, feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="2" stitchTiles="stitch", then feColorMatrix "0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0.09 0" (mid gray at 9%).
The sky: render it once, at twice the page size, and use the image. For each pixel, a ray from an eye at height 1.25, looking ahead along z with a focal length of 1.25 and slightly down (uv.y - 0.02), marches through a cloud layer: density = clamp(2.8 * fbm(p * 0.95) - 1.05 - 0.75 * p.y, 0, 1), fbm being 6 octaves of value noise (each octave x2.03, half the weight). Step 0.03 or 2.5% of the distance, up to 160 steps or until opaque. At each step with cloud, light = clamp((d - density(p + 0.25 * sun)) / 0.4, 0, 1) with the sun at normalize(-0.35, 0.75, 0.55); color = mix(rgb(0.5, 0.6, 0.74), white, 0.2 + 0.8 * light), mixed 25% toward rgb(0.9, 0.93, 0.97) by density; alpha = 0.6 * density; fade it into the sky by 1 - exp(-0.0016 * t * t). The sky behind: mix(rgb(0.66, 0.82, 0.97) at the horizon, rgb(0.15, 0.45, 0.9) overhead) by clamp(rd.y * 1.6 + 0.35, 0, 1)^0.85, plus a faint warm glow toward the sun. The result is deep blue overhead and a sea of white cumulus in the lower half. Let the image drift sideways slowly (100px each way, one sway per loop).
Menu: background var(--grain), rgb(70 98 134 / 0.52); backdrop-filter: blur(36px) saturate(130%); white text; Delete rgb(255 138 126).

Pixel (retro game): drawn in a canvas on a fixed grid of 4px cells, not with the DOM.
Every frame, for each cell, test the cell's center against the bubble's current shape: its position, scale, size, corners of radius 16px (4px where a group joins), and on the last of a group a stepped tail: in the bubble's own frame, with the origin at its bottom corner on the sender's side and x pointing outward, the triangle -10 <= x <= 14, -16 <= y <= 0, y >= -16 + (x + 10) * 16 / 24. Cells inside are filled; cells inside with a neighbor outside are the one-cell outline.
Outline rgb(14 15 34); fill mine rgb(93 112 232), theirs rgb(244 243 236). Dimming mixes the fill toward the background.
Each cell keeps a trace = max(trace * exp(-dt / 0.06s), coverage now) and is drawn when the trace is above the 4x4 Bayer threshold for its position ((value + 0.5) / 16 for 0 8 2 10 / 12 4 14 6 / 3 11 1 9 / 15 7 13 5), so moving bubbles leave a dithered trail. A trace below 1 is drawn in its color mixed toward the background by 0.25 + 0.75 * trace, so the trail keeps its size but stays light. Scale the canvas up with image-rendering: pixelated.
Background: rgb(27 30 52) with 1px lines of white at 3.5% every 4px both ways.
Text stays in the DOM: font-family 'Pixelify Sans'; letter-spacing: 0.02em; mine color rgb(255 255 255) with text-shadow 0 4px 0 rgb(14 15 34 / 0.35); theirs color rgb(14 15 34); its position snapped to the 4px grid. Composer, menu and tabs: square corners, background rgb(244 243 236), and a stepped outline box-shadow: 0 -4px 0 rgb(14 15 34), 0 4px 0 rgb(14 15 34), -4px 0 0 rgb(14 15 34), 4px 0 0 rgb(14 15 34); the send button rgb(93 112 232).

Aqua (playful, nostalgic):
.bubble { border-color: var(--edge); background: var(--face);
box-shadow: inset 0 -14px 18px -8px var(--glow), inset 0 2px 2px rgb(255 255 255 / 0.5), 0 4px 8px -2px rgb(0 30 80 / 0.32);
font-family: 'Lucida Grande'; letter-spacing: -0.01em; }
.bubble.me { --face: linear-gradient(180deg, rgb(116 188 255) 0%, rgb(58 146 242) 48%, rgb(28 111 220) 54%, rgb(43 132 236) 78%, rgb(138 210 255) 100%);
--edge: rgb(21 80 160); --glow: rgb(160 228 255 / 0.95); color: rgb(255 255 255); text-shadow: 0 -1px 1px rgb(0 40 110 / 0.45); }
.bubble.them { --face: linear-gradient(180deg, rgb(253 253 254) 0%, rgb(236 238 241) 48%, rgb(220 223 228) 54%, rgb(228 231 235) 78%, rgb(251 252 253) 100%);
--edge: rgb(141 148 159); --glow: rgb(255 255 255 / 0.95); color: rgb(29 29 31); text-shadow: 0 1px 0 rgb(255 255 255 / 0.7); }
.bubble::before { content: ''; position: absolute; top: 3px; left: 16px; right: 16px; height: min(46%, 36px);
border-radius: 30px 30px 18px 18px; background: linear-gradient(180deg, rgb(255 255 255 / 0.92), rgb(255 255 255 / 0.12)); }
Background: repeating-linear-gradient(180deg, rgb(246 246 246) 0 3px, rgb(233 233 233) 3px 6px).

Gradient (brand):
.bubble.me { --grad: linear-gradient(180deg, rgb(11 127 134) 0%, rgb(13 148 136) 28%, rgb(16 163 127) 60%, rgb(31 191 143) 100%);
background: var(--grad) 0 calc(-1 * var(--top)) / 100% var(--thread-height); color: rgb(255 255 255); }
.bubble.them { background: rgb(38 38 42); color: rgb(244 244 245); }
.bubble { font-weight: 500; letter-spacing: -0.015em; }
--top is the bubble's current offset in the thread, set every frame as it moves, so each bubble shows the slice at its height and changes color as it moves up; the tail of mine shows the slice at the bubble's foot. Background rgb(0 0 0). The send button: linear-gradient(160deg, rgb(31 191 143), rgb(13 148 136) 60%, rgb(11 127 134)) border-box.

Skeuomorphic (warm, tactile):
.bubble { font-family: 'Avenir Next'; font-weight: 500; }
.bubble.me { border-color: rgb(18 22 31); background: linear-gradient(180deg, rgb(72 81 100) 0%, rgb(39 48 66) 100%);
box-shadow: inset 0 2px 0 rgb(255 255 255 / 0.18), inset 0 2px 6px rgb(255 255 255 / 0.08), inset 0 -2px 0 rgb(0 0 0 / 0.22),
0 2px 4px rgb(15 23 42 / 0.18), 0 10px 22px -8px rgb(15 23 42 / 0.36);
color: rgb(255 255 255); text-shadow: 0 -2px 0 rgb(0 0 0 / 0.28); }
.bubble.them { border-color: rgb(15 23 42 / 0.14); background: linear-gradient(180deg, rgb(255 255 255) 0%, rgb(242 243 245) 100%);
box-shadow: inset 0 2px 0 rgb(255 255 255), inset 0 -2px 0 rgb(15 23 42 / 0.06), 0 2px 4px rgb(15 23 42 / 0.06), 0 8px 18px -8px rgb(15 23 42 / 0.18);
color: rgb(31 41 55); text-shadow: 0 1px 0 rgb(255 255 255); }
Background rgb(245 242 233).

Solid (the default):
.bubble.me { background: rgb(10 132 255); color: rgb(255 255 255); }
.bubble.them { background: rgb(233 233 235); color: rgb(0 0 0); }
No shadow; white background.

3. The thread moves as one
- Lay the thread out from the bottom up, above the composer, and place each bubble with transform: translateY. When a message is added, removed or resized, compute every bubble's new place and let each one follow it on its own spring, from where it is now. No other bubble needs an animation of its own. If the list must stay in normal flow, do the same with FLIP.
- Springs (response, damping): cirrus 0.5s 0.88, pixel 0.42s 0.8, aqua 0.46s 0.74, gradient 0.52s 0.92, skeuomorphic 0.34s 0.84, solid 0.42s 0.86.
- Never animate top, height or margin, and never let two bubbles overlap.

4. Send
The bubble rises from about 40px below its place and comes in the material's way:
- Cirrus: clear glass that frosts over: backdrop blur and tint from 0 to full over 560ms ease-out, scale 0.94 to 1 over 420ms, fade in over 200ms.
- Pixel: scale 0.3 to 1 over 380ms on cubic-bezier(.22, 1, .36, 1), stepping on the grid; it fades in through the dither over 200ms; text appears once it is nearly full size.
- Aqua: jelly: scale 0.5 to 1 on a spring (response 0.5s, damping 0.5) while width and height wobble against each other, 12% apart at first and dying out in about 0.2s; never let it grow taller than 1.04 of its size, so it can't reach the message above.
- Gradient: out of focus: blur 16px to 0 and scale 0.96 to 1 over 440ms on cubic-bezier(.22, 1, .36, 1), fade in over 300ms.
- Skeuomorphic: like a key: scale 1.1 to 1 on a spring (response 0.36s, damping 0.55) that dips under 1 first.
- Solid: scale 0.9 to 1 over 380ms on cubic-bezier(.22, 1, .36, 1), fade in over 120ms.

5. Long reply
- While the AI is typing, show a small dot matrix on its own, with no bubble around it: about 48px square, where the reply will start. Each material runs a small piece of physics on it, on a loop:
- Cirrus 6x6: warmth let out along a slow circle (one turn in 2.2s) spreading like heat: the sum of Gaussians left behind over the last second, each wider and fainter with age.
- Pixel 6x6: a pendulum hung from the top middle, angle 0.9 cos(2πt / 1.1s), the bob bright and the rod faint, shown as square dots in four levels.
- Aqua 5x5: drops on water every 0.9s, rings travelling out and dying away (an exponentially decaying cosine in radius minus time).
- Gradient 6x6: two equal lights orbiting their center, one turn in 1.3s, colored mint to teal across the grid.
- Skeuomorphic 4x4: a ball bouncing: a parabola in time between bounces (0.62s apart) and a steady drift across, turned back by the walls.
- Solid 5x5: a plucked string, the fundamental plus a quieter second mode at twice the frequency.
Write each as a smooth function of time so brightness changes continuously, never on or off. Give the moving ones motion blur by averaging each frame over a short shutter (1/30 to 1/20s). Keep the dots flat, one color per material that stands out on its background, faint at rest and fuller as they light; no gloss or bevel.
- When the reply lands, the bubble appears where the matrix was and opens from that corner to the message's size while the matrix fades out: cirrus on a soft spring over 640ms, aqua on a spring a little past its size over 760ms, skeuomorphic on a short spring over 520ms, the others over 520 to 600ms on cubic-bezier(.22, 1, .36, 1). Clip the text, already laid out, so lines never rewrap. Hold the thread above to the opening bubble instead of the spring, so nothing overlaps.
- The words come in one after another, starting 160ms in: rising 10px as they fade in (cirrus, 18ms apart, 360ms each), typed in at once (pixel, 26ms apart), popping up from 0.4 on cubic-bezier(.34, 1.56, .64, 1) (aqua, 16ms, 300ms), sharpening out of an 8px blur while rising 6px (gradient, 14ms, 320ms), stamped in from 1.14 (skeuomorphic, 22ms, 160ms), fading in (solid, 14ms, 240ms).

6. Delete from the middle
- A long press presses the bubble to 0.94 to 0.97, then lifts it to 1.02 to 1.04, while the others dim to 35 to 50% (gradient also blurs them 4px). The menu opens under it, on the bubble's side, with Copy, Regenerate, Read aloud and Delete (Delete in red), coming in the material's way: frosting over (cirrus), a stepped wipe from the top in five steps (pixel), a pop from 0.7 (aqua), a focus pull from a 12px blur (gradient), a short drop from 14px above on a spring (skeuomorphic), a scale from 0.88 (solid).
- On Delete the menu leaves in 160 to 200ms ease-in and the bubble goes in the material's way: melts back to clear glass, then fades (cirrus, 420ms); breaks up into cells that vanish at once in a scattered order, with no trail (pixel, 360ms); swells to 1.14 and pops (aqua, 320ms); dissolves into a 24px blur while growing to 1.12 (gradient, 380ms); is pressed to 0.94, then drops 36px and fades, with no blur (skeuomorphic, 320ms); shrinks to 0.7 with an 8px blur (solid, 260ms).
- Take it out of the layout as it starts to leave. The messages above settle into the gap while the ones below stay put, the one nearest the gap first, about 60ms in, and each one above it 50 to 80ms after the one below. Let each land on the message below it: when it reaches its place still moving down, flip its velocity and keep 20 to 45% of it (aqua most, gradient least), so it bounces up a little and never sinks into the one below. If the messages either side of the gap are from the same sender, they join into one group.

7. Keep it right
- Animate transform, opacity and filter only (backdrop-filter for the glass).
- A new action interrupts the running one from where it is; nothing waits for an animation. Switching material mid-motion fades the thread out and back in the new material from wherever it is.
- Respect prefers-reduced-motion: keep the fades, drop movement, scale and blur, hold the typing matrix on one still frame, and place the thread at once.
- Keep the thread pinned to the bottom while messages arrive, unless the user has scrolled up.

8. Deliver
- First list what you found (retrofit) or what you will build (rebuild), and the material(s) you will use.
- Then build it, and list every file you touched.
- Retrofit: don't change the message data, the components' props, the way messages load or any icon, and leave the composer, the menu and the typing indicator alone unless I said yes to them. If something does not fit this plan, ask me first.

质感来自可解释的细节

消息气泡的材质不是皮肤,而是动效的物理来源。

玻璃会结霜,像素会留下网格拖影,果冻会回弹,渐变会随着在对话中的位置流动,拟物按键会被压下,纯色则提供清楚的基准。只要材质、线程位移、等待状态和退出方式遵守同一种因果关系,聊天界面才会像一个完整的产品,而不是六套随机组合的视觉特效。

站内搜索

没有找到内容!